<?php
include('dbconnect.php');
$uti_id = (isset($_GET['uti_id']))? $_GET['uti_id'] : $uti_id;
$act_date = (isset($_GET['act_date']))? $_GET['act_date'] : $act_date;
$act_texte = (isset($act_texte))? $act_texte: '';
$num_action = (isset($_GET['num_action']))? $_GET['num_action'] : $num_action;
?>
<div id='action<?=$num_action?>'>
	Par 
	<select name='utilisateur<?=$num_action?>' id='utilisateur<?=$num_action?>'>	
<?php
$sql = "SELECT uti_id, uti_nom, uti_prenom, uti_code FROM utilisateurs WHERE uti_actif='1' ORDER BY uti_nom";
if ($result=$db->query($sql)){
	$nb = $result->num_rows;
	for ($j = 0; $j < $nb; $j++){
		$row = $result->fetch_assoc();
?>
	<option value='<?=$row['uti_id']?>' <?=($row['uti_id']==$uti_id)? "selected='selected'":''?>><?=htmlspecialchars($row['uti_nom'])?></option>
<?php	
	}
}
$result->free();
?>
	</select>
	pour le
	<input type='text' name='date<?=$num_action?>' id='date<?=$num_action?>' value='<?=$act_date?>' onclick="displayDatePicker('date<?=$num_action?>');">
	
	<br/>
	<textarea name='texte<?=$num_action?>' id='texte<?=$num_action?>' style='width:95%' rows='3'><?=$act_texte?></textarea>
<?php
if ($num_action!=0){
?>
	<a href='JavaScript:SupprAction(<?=$num_action?>)'>Enlever</a>
<?php
}
?>
</div>

<script language="JavaScript" type="text/javascript">
	dernier = dernier+1;
</script>
